package day8;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

/**
 * @author oldliu
 * @since 1.0
 */
public class FileTest5 {
    public static void main(String[] args) {
        //从文件中读，文件必须存在
        try {
            FileInputStream fin=new FileInputStream("E:\\temp\\java78\\chenyi\\java78.txt");
            int i = fin.read();
            System.out.println((char)i);
            int j = fin.read();//流水线
            System.out.println((char)j);
            int k = fin.read();//流水线
            System.out.println((char)k);

            fin.skip(4);
            //汉字3个字节
            int h=fin.read();
            System.out.println(h+":"+(char)h);
            fin.close();//有隐患
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
